package cos.android.tim.utils;

import cos.android.tim.element.Element;

public class Interactions {

	public static boolean interaction(Element element1, Element element2) {

		Point centerE1 = new Point(element1.getCenterX(), element1.getCenterY());
		Point centerE2 = new Point(element2.getCenterX(), element2.getCenterY());

		if (Motor.pointPointDistance(centerE1, centerE2) < Motor
				.pointPointDistance(0,
						(element1.getWidth() + element2.getWidth()) / 2, 0,
						(element1.getHeight() + element2.getHeight()) / 2)) {
			return true;
		}
		return false;
	}
}
